<?php

class DeDaux8 extends BaseLoDe
{

    function __construct()
    {
        $this->MAX_CHOICE = 10;
        $this->MIN_VALUE = '0';
        $this->MAX_VALUE = '9';

        $this->typeGame = Constant::GAME_DEDAUx8_TYPE;
        $this->gameName = 'Đề đầu X8';
        $this->rationMoney = 8;
    }

    public function calculateWinMoney($ketquaXoSo)
    {
        // 2 sá»‘ cuá»‘i con lÃ´ Ä‘áº·c biá»‡t
        $arrX80 = json_decode($ketquaXoSo->x80);
        

        $result=0;
		 foreach ($this->arrChoices as $eachchoice){
		 	echo ('<br/>De dau x8 '.($arrX80[0]-$arrX80[0]%10)/10)."...".$eachchoice;
        	if (($arrX80[0]-$arrX80[0]%10)/10==$eachchoice)
        	{
        		$result+=$this->bet/count($this->arrChoices)*$this->rationMoney;
        	}
        }
        
        
        return $result; 
    }

}

?>
